adding missed HURD adoptions
authorCarsten Schoenert <c.schoenert@t-online.de>
Sun, 24 Apr 2016 18:49:46 +0000 (20:49 +0200)
committerCarsten Schoenert <c.schoenert@t-online.de>
Mon, 24 Dec 2018 16:04:10 +0000 (16:04 +0000)
Based on https://lists.alioth.debian.org/pipermail/pkg-mozilla-maintainers/2016-April/027634.html

Gbp-Pq: Topic porting-kfreebsd-hurd
Gbp-Pq: Name adding-missed-HURD-adoptions.patch

ipc/chromium/src/base/file_util_posix.cc
ipc/chromium/src/base/platform_thread.h
ipc/chromium/src/base/platform_thread_posix.cc
ipc/chromium/src/base/port.h
ipc/chromium/src/base/process_util.h
ipc/chromium/src/base/process_util_posix.cc
media/webrtc/signaling/src/sdp/sipcc/cpr_types.h
media/webrtc/trunk/build/build_config.h
security/nss/gtests/google_test/gtest/include/gtest/internal/gtest-port.h
security/sandbox/chromium/build/build_config.h

index d6489740496f388e615e76add9aea91e9cad21fe..a408640599d0e6d5db0dce4caecc5aafaf084c07 100644 (file)
@@ -279,7 +279,7 @@ bool GetTempDir(FilePath* path) {
 }
 
 bool GetShmemTempDir(FilePath* path) {
-#if defined(OS_LINUX) && !defined(ANDROID)
+#if (defined(OS_LINUX) && !defined(ANDROID)) || defined(OS_HURD)
   *path = FilePath("/dev/shm");
   return true;
 #else
index 3432128a68879450620cd190fbf4205691628feb..9092ace6dcc5d53695e77438dc1233d0f789df63 100644 (file)
@@ -24,7 +24,7 @@ typedef void* PlatformThreadHandle;  // HANDLE
 #elif defined(OS_POSIX)
 #include <pthread.h>
 typedef pthread_t PlatformThreadHandle;
-#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__)
+#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__) || defined(OS_HURD)
 #include <unistd.h>
 typedef pid_t PlatformThreadId;
 #elif defined(OS_BSD)
index 5f9108d2b095ada5a550c1eef79321385d293a60..ec7eb1bcd622c01873855a3327ea4de901dea247 100644 (file)
@@ -57,7 +57,7 @@ PlatformThreadId PlatformThread::CurrentId() {
 #else
    return getpid();
 #endif
-#elif defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__)
+#elif defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(__GLIBC__) || defined(OS_HURD)
   return (intptr_t) (pthread_self());
 #elif defined(OS_NETBSD)
   return _lwp_self();
index d206d2530e555b72e08cb3d89d7e0e6b7b6d6f2e..13a90bf58102c1de6081bf2686c769b1abcc54db 100644 (file)
@@ -58,7 +58,7 @@ namespace base {
 // Define an OS-neutral wrapper for shared library entry points
 #if defined(OS_WIN)
 #define API_CALL __stdcall
-#elif defined(OS_LINUX) || defined(OS_MACOSX)
+#elif defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_HURD)
 #define API_CALL
 #endif
 
index d9d9396237fa2919245d804d7b826d819761276d..4370731973f14a6f5c1a55fbba9e20f0205b06ba 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef STDOUT_FILENO
 #define STDOUT_FILENO 1
 #endif
-#elif defined(OS_LINUX) || defined(__GLIBC__)
+#elif defined(OS_LINUX) || defined(__GLIBC__) || defined(OS_HURD)
 #include <dirent.h>
 #include <limits.h>
 #include <sys/types.h>
index 4475b3e14873b8022dec8228f7b1959eba737fa6..e8ca219745c5ae08a1c34374ece24d4dbf0cf4d3 100644 (file)
@@ -138,6 +138,10 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) {
   static const rlim_t kSystemDefaultMaxFds = 1024;
   // at least /dev/fd will exist
   static const char kFDDir[] = "/dev/fd";
+#elif defined(OS_HURD)
+  static const rlim_t kSystemDefaultMaxFds = 1024;
+  // Currently always empty, but it exists
+  static const char kFDDir[] = "/dev/fd";
 #endif
 
   // Get the maximum number of FDs possible.
@@ -221,7 +225,7 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) {
 void SetAllFDsToCloseOnExec() {
 #if defined(OS_LINUX) || defined(OS_SOLARIS)
   const char fd_dir[] = "/proc/self/fd";
-#elif defined(OS_MACOSX) || defined(OS_BSD)
+#elif defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_HURD)
   const char fd_dir[] = "/dev/fd";
 #endif
   ScopedDIR dir_closer(opendir(fd_dir));
index f048e72be1cffb8050a4b8302c4b7c891e1fe047..8bb0b596f53975085bd671b98ecfc2a7b88a3f10 100644 (file)
@@ -7,7 +7,7 @@
 
 #include <inttypes.h>
 
-#if defined SIP_OS_LINUX
+#if defined SIP_OS_LINUX || defined(SIP_OS_HURD)
 #include "cpr_linux_types.h"
 #elif defined SIP_OS_WINDOWS
 #include "cpr_win_types.h"
index 168fbd67f4532c2e3f35da5b3abc75cc1d09279e..312674baab0074d16352ba068344beadab059229 100644 (file)
@@ -37,6 +37,9 @@
 #elif defined(_WIN32)
 #define OS_WIN 1
 #define TOOLKIT_VIEWS 1
+#elif defined(__GNU__)
+#define OS_HURD 1
+#define TOOLKIT_GTK
 #elif defined(__DragonFly__)
 #define OS_DRAGONFLY 1
 #define TOOLKIT_GTK
@@ -70,7 +73,8 @@
 // For access to standard POSIXish features, use OS_POSIX instead of a
 // more specific macro.
 #if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) ||      \
-    defined(OS_SOLARIS) || defined(OS_ANDROID) || defined(OS_NACL)
+    defined(OS_SOLARIS) || defined(OS_ANDROID) || defined(OS_NACL) ||   \
+    defined(OS_HURD)
 #define OS_POSIX 1
 #endif
 
index f376dfa004f75424d144f9440033be9e0a41c234..0f702ebb6b38352ceea156f1465ce8e07b246ad9 100644 (file)
 # define GTEST_OS_OPENBSD 1
 #elif defined __QNX__
 # define GTEST_OS_QNX 1
+#elif defined(__GNU__)
+# define GTEST_OS_HURD 1
 #endif  // __CYGWIN__
 
 // Macros for disabling Microsoft Visual C++ warnings.
@@ -611,7 +613,7 @@ struct _RTL_CRITICAL_SECTION;
 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
 // to your compiler flags.
 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
-    || GTEST_OS_QNX)
+    || GTEST_OS_QNX || GTEST_OS_HURD)
 #endif  // GTEST_HAS_PTHREAD
 
 #if GTEST_HAS_PTHREAD
@@ -791,7 +793,7 @@ using ::std::tuple_size;
      (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \
      (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
      GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
-     GTEST_OS_OPENBSD || GTEST_OS_QNX)
+     GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_HURD)
 # define GTEST_HAS_DEATH_TEST 1
 # include <vector>  // NOLINT
 #endif
index 8e5fcd7dedd2776e923b2385af964e14ed7ac5ff..91720912fd7ba17c48b1b97c301ddd1ed600bf65 100644 (file)
@@ -47,6 +47,8 @@
 // we really are using glibc, not uClibc pretending to be glibc
 #define LIBC_GLIBC 1
 #endif
+#elif defined(__GNU__)
+#define OS_HURD 1
 #elif defined(_WIN32)
 #define OS_WIN 1
 #elif defined(__Fuchsia__)
@@ -84,7 +86,7 @@
 #if defined(OS_AIX) || defined(OS_ANDROID) || defined(OS_FREEBSD) ||  \
     defined(OS_FUCHSIA) || defined(OS_LINUX) || defined(OS_MACOSX) || \
     defined(OS_NACL) || defined(OS_NETBSD) || defined(OS_OPENBSD) ||  \
-    defined(OS_QNX) || defined(OS_SOLARIS)
+    defined(OS_QNX) || defined(OS_SOLARIS) || defined(OS_HURD)
 #define OS_POSIX 1
 #endif